import { IPSWFEmbedWFProcess } from './ipswfembed-wfprocess';
import { IPSWFProcessRole } from './ipswfprocess-role';
import { IPSWFProcessSubWF } from './ipswfprocess-sub-wf';
import { PSWFProcessImpl } from './pswfprocess-impl';

export class PSWFEmbedWFProcessImpl extends PSWFProcessImpl implements IPSWFEmbedWFProcess {
  get multiInstMode(): 'NONE' | 'PARALLEL' | 'SEQUENTIAL' {
    return this.M.multiInstMode || 'NONE';
  }

  protected pswfprocessroles: IPSWFProcessRole[] | null = null;

  getPSWFProcessRoles(): IPSWFProcessRole[] | null {
    if (this.pswfprocessroles == null) {
      this.pswfprocessroles = this.fillChildListModel(this.M.getPSWFProcessRoles, 'wf.IPSWFProcessRole') as IPSWFProcessRole[];
    }
    return this.pswfprocessroles;
  }

  get psWFProcessRoles(): IPSWFProcessRole[] | null {
    return this.getPSWFProcessRoles();
  }

  findPSWFProcessRole(objKey: any): IPSWFProcessRole | null {
    return this.getPSModel5('wf.IPSWFProcessRole', this.getPSWFProcessRoles(), objKey) as IPSWFProcessRole;
  }

  protected pswfprocesssubwfs: IPSWFProcessSubWF[] | null = null;

  getPSWFProcessSubWFs(): IPSWFProcessSubWF[] | null {
    if (this.pswfprocesssubwfs == null) {
      this.pswfprocesssubwfs = this.fillChildListModel(this.M.getPSWFProcessSubWFs, 'wf.IPSWFProcessSubWF') as IPSWFProcessSubWF[];
    }
    return this.pswfprocesssubwfs;
  }

  get psWFProcessSubWFs(): IPSWFProcessSubWF[] | null {
    return this.getPSWFProcessSubWFs();
  }

  findPSWFProcessSubWF(objKey: any): IPSWFProcessSubWF | null {
    return this.getPSModel5('wf.IPSWFProcessSubWF', this.getPSWFProcessSubWFs(), objKey) as IPSWFProcessSubWF;
  }

  get cls(): string {
    return 'PSWFEmbedWFProcessImpl';
  }

  instanceof(cls: string): boolean {
    if (cls == 'wf.IPSWFEmbedWFProcess') return true;
    return super.instanceof(cls);
  }
}
